package com.hukun;

import com.hukun.clazz.BMWCar;
import com.hukun.clazz.BYDCar;
import com.hukun.clazz.Car;
import com.hukun.clazz.秦;
import com.hukun.inter.Bike;
import com.hukun.inter.Plane;
import com.hukun.inter.Vehicle;

public class Test {

    public static void main(String[] args) {
        //class
        秦 秦demo = new 秦("秦");
        // 秦demo.charge="新电池";
        秦demo.setCharge("BYd新电池2");
        System.out.println(秦demo);


        BMWCar bmwCar = new BMWCar("bmw");

        //interface
        Bike bike28 = new Bike();
        bike28.Drive();
        bike28.rotate();
        Plane plane = new Plane();
        plane.Drive();
        plane.rotate();


        //多态  一个类的多种对象的实例的多种形态
//class
        Car bmwcar = new BMWCar("宝马");
        Car bydcar = new BYDCar("byd");
        WishCar(bmwcar);
        WishCar(bydcar);
        BMWCar bmwcar2 = new BMWCar("宝马750");

        WishBMWCar(bmwcar2);

        //抽象类 不能被实例化
        //Car car = new Car();
//interface

        Vehicle bike = new Bike();
        Vehicle pane = new Plane();
        repireVehicle(bike);
        repireVehicle(pane);
//接口也不能被实例化
        //Vehicle vehicle = new Vehicle();
    }
//多态最基本的使用方式
    public static  void WishCar(Car car)
    {
        System.out.println("洗"+car.getBrand());
    }


    public static  void WishBMWCar(BMWCar car)
    {
        System.out.println("洗"+car.getBrand());
    }
    //多态最基本的使用方式
    public static  void repireVehicle(Vehicle vehicle)
    {
        System.out.println("修"+vehicle);
    }


}
